/*******************************************************************************
  * 文件：ADTab.h
  * 作者：wanglong
  * 版本：v1.0
  * 日期：2024-11-28
  * 说明：模拟量，电压、电流、IGBT温度、面板温度AD表
*******************************************************************************/
#ifndef _AD_TAB_H_
#define _AD_TAB_H_

#include "Typedefine.h"

/*
//AD-电压拟合曲线y=ax+b，y为电压，x为AD值，拟合后放大64倍
//y=121.47*x+2.56，取整数并补偿为121、4，根据曲线计算电压，
序号为AD值，元素为对应电压值，范围170~270v
*/
const U16 AD_Volt_Tab[] =
{
//   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,  16,  17,  18,  19,
   170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
//  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,  32,  33,  34,  35,  36,  37,  38,  39,
   170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
//  40,  41,  42,  43,  44,  45,  46,  47,  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,
   170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
//  60,  61,  62,  63,  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
   170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
//  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96,  97,  98,  99,
   170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 172, 174, 176, 178, 180, 182, 183, 185, 187,
// 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
   189, 191, 193, 195, 197, 199, 200, 202, 204, 206, 208, 210, 212, 214, 216, 217, 219, 221, 223, 225,
// 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139,
   227, 229, 231, 233, 235, 236, 238, 240, 242, 244, 246, 248, 250, 252, 253, 255, 257, 259, 261, 263,
// 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
   265, 267, 269, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
// 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179,
   270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
// 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
   270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
// 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219,
   270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
// 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
   270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
// 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255
   270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270
};

//佛 山 市 顺 德 区 晶 铭 电 子 有 限 公 司
//MJSP-103-3950-1-190P
//R25℃=10KΩ±1% B25℃/50℃=3950±1%
//序号为AD值，元素为对应温度，最低0（实际最低-30，负数记为0）
const U8 AD_IGBT_TemperTab[] =
{
//   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,  16,  17,  18,  19,
   124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
//  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,  32,  33,  34,  35,  36,  37,  38,  39,
   124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
//  40,  41,  42,  43,  44,  45,  46,  47,  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,
   124, 124, 124, 124, 124, 124, 124, 124, 123, 123, 122, 121, 120, 119, 118, 117, 116, 116, 115, 114,
//  60,  61,  62,  63,  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
   113, 112, 112, 111, 110, 109, 109, 108, 107, 107, 106, 105, 105, 104, 103, 103, 102, 101, 101, 100,
//  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96,  97,  98,  99,
    99,  99,  98,  98,  97,  97,  96,  95,  95,  94,  94,  93,  93,  92,  91,  91,  90,  90,  89,  89,
// 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
    88,  88,  87,  87,  86,  86,  85,  85,  84,  84,  83,  83,  82,  82,  81,  81,  80,  80,  79,  79,
// 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139,
    78,  78,  77,  77,  76,  76,  76,  75,  75,  74,  74,  73,  73,  72,  72,  71,  71,  70,  70,  70,
// 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
    69,  69,  68,  68,  67,  67,  66,  66,  65,  65,  65,  64,  64,  63,  63,  62,  62,  61,  61,  60,
// 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179,
    60,  60,  59,  59,  58,  58,  57,  57,  56,  56,  55,  55,  54,  54,  53,  53,  52,  52,  51,  51,
// 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
    51,  50,  50,  49,  49,  48,  48,  47,  46,  46,  45,  45,  44,  44,  43,  43,  42,  42,  41,  41,
// 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219,
    40,  39,  39,  38,  38,  37,  37,  36,  35,  35,  34,  33,  33,  32,  31,  31,  30,  29,  29,  28,
// 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
    27,  26,  26,  25,  24,  23,  22,  21,  21,  20,  19,  18,  17,  16,  15,  14,  13,  11,  10,  9,
// 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255
	 8,   6,   5,   3,   2,   0,   0,   0,   0,   0,    0,  0,   0,   0,    0,  0
};

//佛 山 市 顺 德 区 晶 铭 电 子 有 限 公 司
//R(200℃) = 0.550KΩ±3%
//B(100/200) = 4300±2%
//序号为AD值，元素为对应温度，最低0（实际最低-40，负数记为0），最高255（实际高于255）
//AD参考电压5V,分压电阻5.1K上拉
const U8 AD_PanelTemper_Tab[] =
{
//   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,  16,  17,  18,  19,
   255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 251, 245, 240, 235, 231, 227, 223, 220, 216,
//  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,  32,  33,  34,  35,  36,  37,  38,  39,
   213, 210, 208, 205, 203, 200, 198, 196, 194, 192, 190, 188, 186, 185, 183, 181, 180, 178, 177, 175,
//  40,  41,  42,  43,  44,  45,  46,  47,  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,
   174, 173, 171, 170, 169, 167, 166, 165, 164, 163, 162, 161, 159, 158, 157, 156, 155, 155, 154, 153,
//  60,  61,  62,  63,  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
   152, 151, 150, 149, 148, 147, 147, 146, 145, 144, 143, 143, 142, 141, 140, 139, 139, 138, 137, 137,
//  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96,  97,  98,  99,
   136, 135, 134, 134, 133, 132, 132, 131, 130, 130, 129, 128, 128, 127, 127, 126, 125, 125, 124, 123,
// 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
   123, 122, 122, 121, 120, 120, 119, 119, 118, 118, 117, 116, 116, 115, 115, 114, 114, 113, 112, 112,
// 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139,
   111, 111, 110, 110, 109, 109, 108, 108, 107, 106, 106, 105, 105, 104, 104, 103, 103, 102, 102, 101,
// 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
   101, 100, 100,  99,  99,  98,  97,  97,  96,  96,  95,  95,  94,  94,  93,  93,  92,  92,  91,  91, 
// 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179,
    90,  90,  89,  89,  88,  87,  87,  86,  86,  85,  85,  84,  84,  83,  83,  82,  81,  81,  80,  80,
// 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
    79,  79,  78,  78,  77,  76,  76,  75,  75,  74,  73,  73,  72,  72,  71,  70,  70,  69,  68,  68,
// 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219,
    67,  66,  66,  65,  64,  64,  63,  62,  62,  61,  60,  59,  59,  58,  57,  56,  56,  55,  54,  53,
// 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
    52,  51,  50,  50,  49,  48,  47,  46,  45,  44,  43,  41,  40,  39,  38,  37,  35,  34,  33,  31,
// 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255
    30,  28,  26,  24,  22,  20,  18,  16,  13,  10,   6,   2,   0,   0,   0,   0
};
#endif
/***********************************END OF FILE********************************/
